const ExcelJS = require('exceljs');


// 创建一个新的工作簿
const workbook = new ExcelJS.Workbook();

// 创建一个新的工作表
const worksheet = workbook.addWorksheet('Sheet1');

// 将数据写入工作表中
worksheet.getCell('A1').value = 'Name';
worksheet.getCell('B1').value = 'Age';
worksheet.addRow({ Name: 'Tom', Age: 20 });
worksheet.addRow({ Name: 'Nick', Age: 21 });
worksheet.addRow({ Name: 'John', Age: 19 });

console.log(worksheet)

// 将工作簿保存为 .xlsx 文件
// const writePath = 'data.xlsx';
// workbook.xlsx.writeFile(writePath).then(() => {
//     console.log('Excel file saved successfully.');
// });

